package com.sqsf.controller;

import com.sqsf.javabean.Student;
import com.sqsf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


    @Controller
    public class StudentController {
        @Autowired
        StudentService studentService;

        @RequestMapping("/all")
        public String all(HttpServletRequest request){
            List<Student> all = studentService.findAll();
            request.setAttribute("data",all);
            return "test";
        }
    }

